import 'package:flutter/src/services/message_codec.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:qm_line/model/response.dart';
import 'package:qm_line/qm_line.dart';
import 'package:qm_line/qm_line_platform_interface.dart';
import 'package:qm_line/qm_line_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockQmLinePlatform
    with MockPlatformInterfaceMixin
    implements QmLinePlatform {
  @override
  void addEventHandler(Future Function(MethodCall p1)? handler) {
    // TODO: implement addEventHandler
  }

  @override
  Future<QMResponse> beginChatSession(String peerId, Map param) {
    // TODO: implement beginChatSession
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> deleteMessage(String messageId) {
    // TODO: implement deleteMessage
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> getMessage(String messageId) {
    // TODO: implement getMessage
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> getMessageList(int page) {
    // TODO: implement getMessageList
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> getUnreadMessageCount(String accessId, String username, String userId) {
    // TODO: implement getUnreadMessageCount
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> getUnreadMessageList(String afterMsgId) {
    // TODO: implement getUnreadMessageList
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> initSDK(String accessId, String userName, String userId) {
    // TODO: implement initSDK
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> leaveMessage(String peerId, String message) {
    // TODO: implement leaveMessage
    throw UnimplementedError();
  }

  @override
  void quitSDK() {
    // TODO: implement quitSDK
  }

  @override
  Future<QMResponse> resendMessage(String messageId) {
    // TODO: implement resendMessage
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> sendFileMessage(String filePath, String fileName, String fileSize) {
    // TODO: implement sendFileMessage
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> sendImageMessage(String imagePath) {
    // TODO: implement sendImageMessage
    throw UnimplementedError();
  }

  @override
  Future<QMResponse> sendTextMessage(String text) {
    // TODO: implement sendTextMessage
    throw UnimplementedError();
  }

  @override
  void switchServiceRoute(QMServiceLine serviceLine) {
    // TODO: implement switchServiceRoute
  }
  // @override
  // Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final QmLinePlatform initialPlatform = QmLinePlatform.instance;

  test('$MethodChannelQmLine is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelQmLine>());
  });

  test('getPlatformVersion', () async {
    // QmLine qmLinePlugin = QmLine();
    MockQmLinePlatform fakePlatform = MockQmLinePlatform();
    QmLinePlatform.instance = fakePlatform;

    // expect(await qmLinePlugin.getPlatformVersion(), '42');
  });
}
